//引入
let http = require("http");

//创建服务器
let server = http.createServer();

server.on("request", function (req, resp) {
    console.log(req.url);
    console.log(decodeURIComponent(req.url));
    console.log(req.method);

    resp.setHeader("Content-Type", "text/html; charset=utf-8");
    resp.end("123，你好NodeJS");
});

server.listen(8080, function () {
    console.log("服务器启动成功");
});